<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // let obj1 = {
        //     name:"老王",
        //     age:18
        // }
        // let obj2 = {
        //     name:"小李",
        //     age:19
        // }

        // let obj2 = obj1;

        // let bool = Object.is(obj1,obj2); //=== 和全等一样
        // console.log(bool);
        
        // console.log(obj1===obj2); //true

        // console.log(NaN === NaN); //false

        //console.log(Object.is(NaN,NaN)); //true //完美解决它的人格分裂问题，自己等于自己

        // 判断数字是否是NaN
        // let n = isNaN(NaN);
        // console.log(n);

        // 合并对象
        let obj = {
            name:"老王"
        }
        let obj2 = {
            age:18
        }

        // let obj3 = {...obj,...obj2};

        let obj3 = Object.assign(obj,obj2);

        // console.log(obj3);

        console.log(Object.keys(obj3)); //['name', 'age']

        console.log(Object.values(obj3));//['老王', 18]
            





        

    </script>
</body>
</html>